#include "Class/Scene/Game.hpp"

#include "Template/SubEntity/Polygon.hpp"

namespace		Scene
{
  void			Game::Draw() const throw()
  {
	SubEntity::Square3D	square;

	this->_Graphics.SetDefault3DCamera();

	this->_RandomImage->Bind();
	glBegin(GL_TRIANGLES);
	{
	  glColor3ub(255, 255, 255);
	  glTexCoord2f(.0f, 1.f);
	  glVertex3f(-20.f, 20.f, .0f);
	  glTexCoord2f(1.f, 1.f);
	  glVertex3f(.0f, 20.f, .0f);
	  glTexCoord2f(1.f, .0f);
	  glVertex3f(.0f, .0f, .0f);
	}
	glEnd();

	square.SetPosition(Component::Vector3f(-10.f, -10.f, .0f), 0);
	square.SetPosition(Component::Vector3f(10.f, -10.f, .0f), 1);
	square.SetPosition(Component::Vector3f(10.f, 10.f, .0f), 2);
	square.SetPosition(Component::Vector3f(-10.f, 10.f, .0f), 3);
	square.SetTexturePosition(Component::Vector2f(.0f, .0f), 0);
	square.SetTexturePosition(Component::Vector2f(1.f, .0f), 1);
	square.SetTexturePosition(Component::Vector2f(1.f, 1.f), 2);
	square.SetTexturePosition(Component::Vector2f(.0f, 1.f), 3);
	SubEntity::Square3D::StartDraw();
	square.Draw(this->_Graphics);
	SubEntity::Square3D::StopDraw();


	this->_Graphics.SetDefaultGUICamera();
	this->_RandomImage->Draw(this->_Graphics);
  }
}
